﻿using BinAnalysisHelp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


/// <summary>
/// setting1-00 区地址的信息
/// </summary>
public class PuctHelp
{
    public static PuctModel PU_BRIGHTNESS_CONTROL = new PuctModel { name = "亮度", def_addr_h = "69ed", def_addr_l = "69ec", def_val = "05", max_addr_h = "69e7", max_addr_l = "69e6", min_addr_h = "69e9", min_addr_l = "69e8", cur_addr_h = "0002", cur_addr_l = "0003", max_val = "0a", min_val = "00" };
    public static PuctModel PU_CONTRAST_CONTROL = new PuctModel { name = "对比度", def_addr_h = "69f9", def_addr_l = "69f8", def_val = "0a", max_addr_h = "69f3", max_addr_l = "69f2", min_addr_h = "69f5", min_addr_l = "69f4", cur_addr_h = "0004", cur_addr_l = "0005", max_val = "14", min_val = "00" };
    public static PuctModel PU_HUE_CONTROL = new PuctModel { name = "色调", def_addr_h = "6a05", def_addr_l = "6a04", def_val = "0a", max_addr_h = "69ff", max_addr_l = "69fe", min_addr_h = "6a01", min_addr_l = "6a00", cur_addr_h = "000A", cur_addr_l = "000B", max_val = "14", min_val = "00" };
    public static PuctModel PU_SATURATION_CONTROL = new PuctModel { name = "饱和度", def_addr_h = "6a11", def_addr_l = "6a10", def_val = "0a", max_addr_h = "6a0b", max_addr_l = "6a0a", min_addr_h = "6a0d", min_addr_l = "6a0c", cur_addr_h = "000C", cur_addr_l = "000D", max_val = "14", min_val = "00" };
    public static PuctModel PU_SHARPNESS_CONTROL = new PuctModel { name = "清晰度", def_addr_h = "6a1d", def_addr_l = "6a1c", def_val = "00", max_addr_h = "6a17", max_addr_l = "6a16", min_addr_h = "6a19", min_addr_l = "6a18", cur_addr_h = "000E", cur_addr_l = "000F", max_val = "14", min_val = "00" };
    public static PuctModel PU_GAMMA_CONTROL = new PuctModel { name = "伽马", def_addr_h = "6a29", def_addr_l = "6a28", def_val = "01", max_addr_h = "6a23", max_addr_l = "6a22", min_addr_h = "6a25", min_addr_l = "6a24", cur_addr_h = "0010", cur_addr_l = "0011", max_val = "09", min_val = "01" };
    public static PuctModel PU_WHITE_BALANCE_TEMPERATURE_CONTROL = new PuctModel { name = "白平衡", def_addr_h = "6a35", def_addr_l = "6a34", def_val = "04", max_addr_h = "6a2f", max_addr_l = "6a2e", min_addr_h = "6a31", min_addr_l = "6a30", cur_addr_h = "0012", cur_addr_l = "0013", max_val = "05", min_val = "01" };
    public static PuctModel PU_BACKLIGHT_COMPENSATION_CONTROL = new PuctModel { name = "逆光对比", def_addr_h = "6a41", def_addr_l = "6a40", def_val = "00", max_addr_h = "6a3b", max_addr_l = "6a3a", min_addr_h = "6a3d", min_addr_l = "6a3c", cur_addr_h = "0000", cur_addr_l = "0001", max_val = "40", min_val = "00" };
    public static PuctModel PU_GAIN_CONTROL = new PuctModel { name = "增益", def_addr_h = "6a4d", def_addr_l = "6a4c", def_val = "00", max_addr_h = "6a47", max_addr_l = "6a46", min_addr_h = "6a49", min_addr_l = "6a48", cur_addr_h = "0006", cur_addr_l = "0007", max_val = "FF", min_val = "00" };
    public static PuctModel CT_ZOOM_ABSOLUTE_CONTROL = new PuctModel { name = "缩放", };
    public static PuctModel CT_FOCUS_ABSOLUTE_CONTROL = new PuctModel { name = "焦点", def_addr_h = "6a95", def_addr_l = "6a94", def_val = "200", max_addr_h = "6a8f", max_addr_l = "6a8e", min_addr_h = "6a91", min_addr_l = "6a90", cur_addr_h = "0034", cur_addr_l = "0035", max_val = "3FF", min_val = "00" };
    public static PuctModel CT_AE_MODE_CONTROL = new PuctModel { name = "曝光", def_addr_h = "6a89", def_addr_l = "6a88", def_val = "FFFFFFFFFFFFFFF9", max_addr_h = "6a83", max_addr_l = "6a82", min_addr_h = "6a85", min_addr_l = "6a84", cur_addr_h = "0028", cur_addr_l = "0029", max_val = "00", min_val = "FFFFFFFFFFFFFFF3" };
    public static PuctModel Panorama = new PuctModel { name = "全景", };
    public static PuctModel Tilt = new PuctModel { name = "倾斜", };
    public static PuctModel CT_ROLL_ABSOLUTE_CONTROL = new PuctModel { name = "滚动", def_addr_h = "18bd", def_addr_l = "18bd", def_val = "0", max_val = "03", min_val = "0", };
    public static PuctModel PU_POWER_LINE_FREQUENCY_CONTROL = new PuctModel { name = "电源线路频率", def_addr_h = "6a59", def_addr_l = "6a58", def_val = "01", max_addr_h = "6a53", max_addr_l = "6a52", min_addr_h = "6a55", min_addr_l = "6a55", cur_addr_h = "0008", cur_addr_l = "0009", cur_val = "01" };

    public static PuctModel PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL = new PuctModel { name = "自动白平衡", def_addr_h = "6a65", def_addr_l = "6a64", def_val = "-1", max_addr_h = "6a5f", max_addr_l = "6a5e", min_addr_h = "6a61", min_addr_l = "6a60", cur_addr_h = "6a63", cur_addr_l = "6a62", max_val = "05", min_val = "01" };
    public static PuctModel CT_FOCUS_AUTO_CONTROL = new PuctModel { name = "自动焦点", def_addr_h = "6aa1", def_addr_l = "6aa0", def_val = "-1", max_addr_h = "6a77", max_addr_l = "6a9b", min_addr_h = "6a9d", min_addr_l = "6a9c", cur_addr_h = "6a9f", cur_addr_l = "6a9e", max_val = "3FF", min_val = "00" };
    public static PuctModel CT_AE_MODE_AUTO_CONTROL = new PuctModel { name = "自动曝光", def_addr_h = "6a7d", def_addr_l = "6a7c", def_val = "-1", max_addr_h = "6a77", max_addr_l = "6a76", min_addr_h = "6a79", min_addr_l = "6a78", cur_addr_h = "6a7b", cur_addr_l = "6a7a", max_val = "00", min_val = "FFFFFFFFFFFFFFF3" };


    public static PuctModels[] Parameters;

    public static UserParametersUsb userParametersUsb = new UserParametersUsb();
    /// <summary>
    /// 记录App setting区0_01 开始位置
    /// </summary>
    public static int AppSetting0_0StartData = 0;

    /// <summary>
    /// 记录App setting区0_01 长度
    /// </summary>
    public static int AppSetting0_0Count = 0;

    public static bool IsPuct = false;
    /// <summary>
    /// 用于记录是否存咋PUct
    /// </summary>
    public static int PuctIndex = (int)0xFF;


    /// <summary>
    /// VC - Specific VS Video Input Header Descriptor
    /// </summary>
    private static List<BinBase> videoIHDResult;
    public static List<BinBase> VideoIHDResult
    {
        get { return videoIHDResult; }
        set { videoIHDResult = value; }
    }
    /// <summary>
    /// bNumFormats              : 0x02   //总格式的数量  如果是01 只存在一个mjpe 或者yuv
    /// </summary>
    public static int videoIHDNum { get; set; }
    /// <summary>
    /// wTotalLength             : 0x02ED (749 bytes)   //所有格式相关描述符的总长度  先解析这个 
    /// </summary>
    public static int videoIHDTotal { get; set; }
    /// <summary>
    /// bStillCaptureMethod  等于0表示预览/拍照 同分辨率 等于2表示预览/拍照 不同分辨率
    /// </summary>
    public static int videoIHDStillCapture { get; set; }


    /// <summary>
    /// Video Streaming MJPEG Format Type Descriptor -----bDescriptorSubtype       : 0x06 (Format MJPEG)  
    /// </summary>
    private static List<BinBase> videoSFormatMjpegResult;
    public static List<BinBase> VideoSFormatMjpegResult
    {
        get { return videoSFormatMjpegResult; }
        set { videoSFormatMjpegResult = value; }
    }


    /// <summary>
    /// bFrameIndex              : 0x01  ///这个是索引符号
    /// </summary>
    public static int videoSFormatMjpegIndex { get; set; }

    /// <summary>
    ///bNumFrameDescriptors     : 0x11 (17)  //格式的总数
    /// </summary>
    public static int videoSFormatMjpegNum { get; set; }
    /// <summary>
    /// bDefaultFrameIndex       : 0x07 (7) //默认尺寸
    /// </summary>
    public static int videoSFormatMjpegDefaultIndex { get; set; }

    /// <summary>
    /// Mjpeg 集合
    /// </summary>
    private static List<VideoMjpegFType> videoMjpegFTypes;

    public static List<VideoMjpegFType> VideoMjpegFTypes
    {
        get { return videoMjpegFTypes; }
        set { videoMjpegFTypes = value; }
    }
    /// <summary>
    /// VS Uncompressed Format Type Descriptor --------bDescriptorSubtype       : 0x04 (Uncompressed Format Type)   //yuv 固定格式
    /// </summary>
    private static List<BinBase> videoSFormatYuvResult;
    public static List<BinBase> VideoSFormatYuvResult
    {
        get { return videoSFormatYuvResult; }
        set { videoSFormatYuvResult = value; }
    }
    /// <summary>
    ///bFormatIndex             : 0x02 (2)  //视频格式设置   01 和02   01 是默认
    /// </summary>
    public static int videoSFormatYuvIndex { get; set; }

    /// <summary>
    ///bNumFrameDescriptors     : 0x06 (6 Frame Descriptors)   //yuv 总数
    /// </summary>
    public static int videoSFormatYuvNum { get; set; }
    /// <summary>
    /// bDefaultFrameIndex       : 0x04 (Index 4)
    /// </summary>
    public static int videoSFormatYuvDefaultIndex { get; set; }
    /// <summary>
    /// Yuv 集合
    /// </summary>
    public static List<VideoYuvFType> videoYuvFTypes;
    public static List<VideoYuvFType> VideoYuvFTypes
    {
        get { return videoYuvFTypes; }
        set { videoYuvFTypes = value; }
    }

    /// <summary>
    /// Still Image Frame Type Descriptor   第一份
    /// </summary>
    private static List<BinBase> stillImageFrameTypeResultOne;
    public static List<BinBase> StillImageFrameTypeResultOne
    {
        get { return stillImageFrameTypeResultOne; }
        set { stillImageFrameTypeResultOne = value; }
    }

    /// <summary>
    /// Still Image Frame Type Descriptor  第二份
    /// </summary>
    private static List<BinBase> stillImageFrameTypeResultTwo;
    public static List<BinBase> StillImageFrameTypeResultTwo
    {
        get { return stillImageFrameTypeResultTwo; }
        set { stillImageFrameTypeResultTwo = value; }
    }

    private static List<BinBase> configurationDescriptorResult;
    /// <summary>
    /// Configuration Descriptor
    /// </summary>
    public static List<BinBase> ConfigurationDescriptorResult {
        get => configurationDescriptorResult;
        set => configurationDescriptorResult = value; }


    private static List<BinBase> vsColorMatchingDescriptorDescriptor;
    /// <summary>
    /// VS颜色匹配描述符  用判断截图 或者无截图后面的数据 移动到指定地点 如果有更改更改此处
    /// </summary>
    public static List<BinBase> VsColorMatchingDescriptorDescriptor {
        get => vsColorMatchingDescriptorDescriptor;
        set => vsColorMatchingDescriptorDescriptor = value; }

    /// <summary>
    /// 描述符总数据
    /// </summary>
    private static List<BinBase> totalDescription;
    public static List<BinBase> TotalDescription
    {
        get { return totalDescription; }
        set { totalDescription = value; }
    }


    /// <summary>
    /// 描述符的接口数量
    /// </summary>
    private static List<BinBase> bNumInterfaces;
    public static List<BinBase> BNumInterfaces { get => bNumInterfaces; set => bNumInterfaces = value; }

    /// <summary>
    /// 用来存储识别大小端模式进行转换后的识别数据
    /// </summary>
    public static List<BinBase> TResult { get => tResult; set => tResult = value; }

    private static List<BinBase> tResult;


    /// <summary>
    /// 初始化PuctModel对象
    /// </summary>
    public static void InitializePuctModels()
    {
        //PU_BRIGHTNESS_CONTROL = new PuctModel { name = "亮度", def_addr_h = "69ed", def_addr_l = "69ec", def_val = "05", max_addr_h = "69e7", max_addr_l = "69e6", min_addr_h = "69e9", min_addr_l = "69e8", cur_addr_h = "0002", cur_addr_l = "0003", max_val = "0a", min_val = "00" };
        //PU_CONTRAST_CONTROL = new PuctModel { name = "对比度", def_addr_h = "69f9", def_addr_l = "69f8", def_val = "0a", max_addr_h = "69f3", max_addr_l = "69f2", min_addr_h = "69f5", min_addr_l = "69f4", cur_addr_h = "0004", cur_addr_l = "0005", max_val = "14", min_val = "00" };
        //PU_HUE_CONTROL = new PuctModel { name = "色调", def_addr_h = "6a05", def_addr_l = "6a04", def_val = "0a", max_addr_h = "69ff", max_addr_l = "69fe", min_addr_h = "6a01", min_addr_l = "6a00", cur_addr_h = "000A", cur_addr_l = "000B", max_val = "14", min_val = "00" };
        //PU_SATURATION_CONTROL = new PuctModel { name = "饱和度", def_addr_h = "6a11", def_addr_l = "6a10", def_val = "0a", max_addr_h = "6a0b", max_addr_l = "6a0a", min_addr_h = "6a0d", min_addr_l = "6a0c", cur_addr_h = "000C", cur_addr_l = "000D", max_val = "14", min_val = "00" };
        //PU_SHARPNESS_CONTROL = new PuctModel { name = "清晰度", def_addr_h = "6a1d", def_addr_l = "6a1c", def_val = "00", max_addr_h = "6a17", max_addr_l = "6a16", min_addr_h = "6a19", min_addr_l = "6a18", cur_addr_h = "000E", cur_addr_l = "000F", max_val = "14", min_val = "00" };
        //PU_GAMMA_CONTROL = new PuctModel { name = "伽马", def_addr_h = "6a29", def_addr_l = "6a28", def_val = "01", max_addr_h = "6a23", max_addr_l = "6a22", min_addr_h = "6a25", min_addr_l = "6a24", cur_addr_h = "0010", cur_addr_l = "0011", max_val = "09", min_val = "01" };
        //PU_WHITE_BALANCE_TEMPERATURE_CONTROL = new PuctModel { name = "白平衡", def_addr_h = "6a35", def_addr_l = "6a34", def_val = "04", max_addr_h = "6a2f", max_addr_l = "6a2e", min_addr_h = "6a31", min_addr_l = "6a30", cur_addr_h = "0012", cur_addr_l = "0013", max_val = "05", min_val = "01" };
        //PU_BACKLIGHT_COMPENSATION_CONTROL = new PuctModel { name = "逆光对比", def_addr_h = "6a41", def_addr_l = "6a40", def_val = "00", max_addr_h = "6a3b", max_addr_l = "6a3a", min_addr_h = "6a3d", min_addr_l = "6a3c", cur_addr_h = "0000", cur_addr_l = "0001", max_val = "40", min_val = "00" };
        //PU_GAIN_CONTROL = new PuctModel { name = "增益", def_addr_h = "6a4d", def_addr_l = "6a4c", def_val = "00", max_addr_h = "6a47", max_addr_l = "6a46", min_addr_h = "6a49", min_addr_l = "6a48", cur_addr_h = "0006", cur_addr_l = "0007", max_val = "FF", min_val = "00" };
        //CT_ZOOM_ABSOLUTE_CONTROL = new PuctModel { name = "缩放" };
        //CT_FOCUS_ABSOLUTE_CONTROL = new PuctModel { name = "焦点", def_addr_h = "6a95", def_addr_l = "6a94", def_val = "200", max_addr_h = "6a8f", max_addr_l = "6a8e", min_addr_h = "6a91", min_addr_l = "6a90", cur_addr_h = "0034", cur_addr_l = "0035", max_val = "3FF", min_val = "00" };
        //CT_AE_MODE_CONTROL = new PuctModel { name = "曝光", def_addr_h = "6a89", def_addr_l = "6a88", def_val = "FFFFFFFFFFFFFFF9", max_addr_h = "6a83", max_addr_l = "6a82", min_addr_h = "6a85", min_addr_l = "6a84", cur_addr_h = "0028", cur_addr_l = "0029", max_val = "00", min_val = "FFFFFFFFFFFFFFF3" };
        //Panorama = new PuctModel { name = "全景" };
        //Tilt = new PuctModel { name = "倾斜" };
        //CT_ROLL_ABSOLUTE_CONTROL = new PuctModel { name = "滚动", def_addr_h = "18bd", def_addr_l = "18bd", def_val = "0", max_val = "03", min_val = "0" };
        //PU_POWER_LINE_FREQUENCY_CONTROL = new PuctModel { name = "电源线路频率", def_addr_h = "6a59", def_addr_l = "6a58", def_val = "01", max_addr_h = "6a53", max_addr_l = "6a52", min_addr_h = "6a55", min_addr_l = "6a55", cur_addr_h = "0008", cur_addr_l = "0009", cur_val = "01" };
        //PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL = new PuctModel { name = "自动白平衡", def_addr_h = "6a65", def_addr_l = "6a64", def_val = "-1", max_addr_h = "6a5f", max_addr_l = "6a5e", min_addr_h = "6a61", min_addr_l = "6a60", cur_addr_h = "6a63", cur_addr_l = "6a62", max_val = "05", min_val = "01" };
        //CT_FOCUS_AUTO_CONTROL = new PuctModel { name = "自动焦点", def_addr_h = "6aa1", def_addr_l = "6aa0", def_val = "-1", max_addr_h = "6a77", max_addr_l = "6a9b", min_addr_h = "6a9d", min_addr_l = "6a9c", cur_addr_h = "6a9f", cur_addr_l = "6a9e", max_val = "3FF", min_val = "00" };
        //CT_AE_MODE_AUTO_CONTROL = new PuctModel { name = "自动曝光", def_addr_h = "6a7d", def_addr_l = "6a7c", def_val = "-1", max_addr_h = "6a77", max_addr_l = "6a76", min_addr_h = "6a79", min_addr_l = "6a78", cur_addr_h = "6a7b", cur_addr_l = "6a7a", max_val = "00", min_val = "FFFFFFFFFFFFFFF3" };
        
        
        Parameters = new PuctModels[]
        {
        new PuctModels { addL = "0x0000", valL = "0xFF", addH = "0x0001", valH = "0xFF", Note = "PU_BACKLIGHT_COMPENSATION_CONTROL 背光补偿控制" },
        new PuctModels { addL = "0x0002", valL = "0xFF", addH = "0x0003", valH = "0xFF", Note = "PU_BRIGHTNESS_CONTROL 亮度控制" },
        new PuctModels { addL = "0x0004", valL = "0xFF", addH = "0x0005", valH = "0xFF", Note = "PU_CONTRAST_CONTROL 对比度控制" },
        new PuctModels { addL = "0x0006", valL = "0xFF", addH = "0x0007", valH = "0xFF", Note = "PU_GAIN_CONTROL 增益控制" },
        new PuctModels { addL = "0x0008", valL = "0xFF", addH = "0x0009", valH = "0xFF", Note = "PU_POWER_LINE_FREQUENCY_CONTROL 电源线路频率控制" },
        new PuctModels { addL = "0x000A", valL = "0xFF", addH = "0x000B", valH = "0xFF", Note = "PU_HUE_CONTROL 色调控制" },
        new PuctModels { addL = "0x000C", valL = "0xFF", addH = "0x000D", valH = "0xFF", Note = "PU_SATURATION_CONTROL 饱和度控制" },
        new PuctModels { addL = "0x000E", valL = "0xFF", addH = "0x000F", valH = "0xFF", Note = "PU_SHARPNESS_CONTROL 清晰度控制" },
        new PuctModels { addL = "0x0010", valL = "0xFF", addH = "0x0011", valH = "0xFF", Note = "PU_GAMMA_CONTROL 伽马控制" },
        new PuctModels { addL = "0x0012", valL = "0xFF", addH = "0x0013", valH = "0xFF", Note = "PU_WHITE_BALANCE_TEMPERATURE_CONTROL 白平衡温度控制" },
        new PuctModels { addL = "0x0014", valL = "0xFF", addH = "0x0015", valH = "0xFF", Note = "PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL 白平衡温度自动控制" },
        new PuctModels { addL = "0x0016", valL = "0xFF", addH = "0x0017", valH = "0xFF", Note = "PU_WHITE_BALANCE_COMPONENT_CONTROL 白色平衡组件控制" },
        new PuctModels { addL = "0x0018", valL = "0xFF", addH = "0x0019", valH = "0xFF", Note = "PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL 白色平衡组件自动控制" },
        new PuctModels { addL = "0x001A", valL = "0xFF", addH = "0x001B", valH = "0xFF", Note = "PU_DIGITAL_MULTIPLIER_CONTROL 数字多路控制" },
        new PuctModels { addL = "0x001C", valL = "0xFF", addH = "0x001D", valH = "0xFF", Note = "PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL 数字多路复用器限制控制" },
        new PuctModels { addL = "0x001E", valL = "0xFF", addH = "0x001F", valH = "0xFF", Note = "PU_HUE_AUTO_CONTROL 色调自动控制" },
        new PuctModels { addL = "0x0020", valL = "0xFF", addH = "0x0021", valH = "0xFF", Note = "PU_ANALOG_VIDEO_STANDARD_CONTROL 模拟视频标准控制" },
        new PuctModels { addL = "0x0022", valL = "0xFF", addH = "0x0023", valH = "0xFF", Note = "PU_ANALOG_LOCK_STATUS_CONTROL 模拟锁定状态控制" },
        new PuctModels { addL = "0x0024", valL = "0xFF", addH = "0x0025", valH = "0xFF", Note = "PU_CONTRAST_AUTO_CONTROL 对比度自动控制" },
        new PuctModels { addL = "0x0026", valL = "0xFF", addH = "0x0027", valH = "0xFF", Note = "CT_SCANNING_MODE_CONTROL 扫描模式控制" },
        new PuctModels { addL = "0x0028", valL = "0xFF", addH = "0x0029", valH = "0xFF", Note = "CT_AE_MODE_CONTROL AE_MODE控制" },
        new PuctModels { addL = "0x002A", valL = "0xFF", addH = "0x002B", valH = "0xFF", Note = "CT_AE_PRIORITY_CONTROL AE_优先级控制" },
        new PuctModels { addL = "0x002C", valL = "0xFF", addH = "0x002D", valH = "0xFF", Note = "CT_EXPOSURE_TIME_ABSOLUTE_CONTROL 曝光时间吸收控制" },
        new PuctModels { addL = "0x002E", valL = "0xFF", addH = "0x002F", valH = "0xFF", Note = "CT_EXPOSURE_TIME_RELATIVE_CONTROL 曝光时间相对控制" },
        new PuctModels { addL = "0x0030", valL = "0xFF", addH = "0x0031", valH = "0xFF", Note = "CT_FOCUS_ABSOLUTE_CONTROL 焦点_绝对_控制" },
        new PuctModels { addL = "0x0032", valL = "0xFF", addH = "0x0033", valH = "0xFF", Note = "CT_FOCUS_RELATIVE_CONTROL 焦点相对控制" },
        new PuctModels { addL = "0x0034", valL = "0xFF", addH = "0x0035", valH = "0xFF", Note = "CT_FOCUS_AUTO_CONTROL 焦点自动控制" },
        new PuctModels { addL = "0x0036", valL = "0xFF", addH = "0x0037", valH = "0xFF", Note = "CT_IRIS_ABSOLUTE_CONTROL 虹膜绝对控制" },
        new PuctModels { addL = "0x0038", valL = "0xFF", addH = "0x0039", valH = "0xFF", Note = "CT_IRIS_RELATIVE_CONTROL 虹膜相对控制" },
        new PuctModels { addL = "0x003A", valL = "0xFF", addH = "0x003B", valH = "0xFF", Note = "CT_ZOOM_ABSOLUTE_CONTROL 缩放绝对控制" },
        new PuctModels { addL = "0x003C", valL = "0xFF", addH = "0x003D", valH = "0xFF", Note = "CT_ZOOM_RELATIVE_CONTROL 缩放相对控制" },
        new PuctModels { addL = "0x003E", valL = "0xFF", addH = "0x003F", valH = "0xFF", Note = "CT_PANTILT_ABSOLUTE_CONTROL 云台绝对控制" },
        new PuctModels { addL = "0x0040", valL = "0xFF", addH = "0x0041", valH = "0xFF", Note = "CT_PANTILT_RELATIVE_CONTROL 云台相对控制" },
        new PuctModels { addL = "0x0042", valL = "0xFF", addH = "0x0043", valH = "0xFF", Note = "CT_ROLL_ABSOLUTE_CONTROL 滚动绝对控制" },
        new PuctModels { addL = "0x0044", valL = "0xFF", addH = "0x0045", valH = "0xFF", Note = "CT_ROLL_RELATIVE_CONTROL 滚动相对控制" },
        new PuctModels { addL = "0x0046", valL = "0xFF", addH = "0x0047", valH = "0xFF", Note = "CT_PRIVACY_CONTROL 隐私控制" },
        new PuctModels { addL = "0x0048", valL = "0xFF", addH = "0x0049", valH = "0xFF", Note = "CT_FOCUS_SIMPLE_CONTROL 焦点_示例_控制" },
        new PuctModels { addL = "0x004A", valL = "0xFF", addH = "0x004B", valH = "0xFF", Note = "CT_WINDOW_CONTROL 窗口控制" },
        new PuctModels { addL = "0x004C", valL = "0xFF", addH = "0x004D", valH = "0xFF", Note = "CT_REGION_OF_INTEREST_CONTROL 利益控制区域" },
        new PuctModels { addL = "0x004E", valL = "0xFF", addH = "0x004F", valH = "0xFF", Note = "WORD ALIGNMENT 字对齐" },
        };
        userParametersUsb = new UserParametersUsb();
        AppSetting0_0StartData = 0;
        AppSetting0_0Count = 0;
        IsPuct = false;
        PuctIndex = (int)0xFF;
        videoIHDResult = new List<BinBase>();
        videoIHDNum = 0;
        videoIHDTotal = 0;
        videoIHDStillCapture = 0;
        videoSFormatMjpegResult = new List<BinBase>();
        videoSFormatMjpegIndex = 0;
        videoSFormatMjpegNum = 0;
        videoSFormatMjpegDefaultIndex = 0;
        videoMjpegFTypes = new List<VideoMjpegFType>();
        videoSFormatYuvResult = new List<BinBase>();
        videoSFormatYuvIndex = 0;
        videoSFormatYuvNum = 0;
        videoSFormatYuvDefaultIndex = 0;
        videoYuvFTypes = new List<VideoYuvFType>();
        stillImageFrameTypeResultOne = new List<BinBase>();
        stillImageFrameTypeResultTwo = new List<BinBase>();
        configurationDescriptorResult = new List<BinBase>();
        vsColorMatchingDescriptorDescriptor = new List<BinBase>();
        totalDescription = new List<BinBase>();
        bNumInterfaces = new List<BinBase>();
        tResult = new List<BinBase>();
    }


}

public class PuctModel
{
    /// <summary>
    /// 名称
    /// </summary>
    public string name { get; set; }
    public string max_addr_l { get; set; }
    public string max_addr_h { get; set; }
    /// <summary>
    /// 最大值
    /// </summary>
    public string max_val { get; set; } = "FF";
    /// <summary>
    /// 默认不存在
    /// </summary>
    public bool max_bool { get; set; } = false;


    public string min_addr_l { get; set; }
    public string min_addr_h { get; set; }
    /// <summary>
    /// 最小值
    /// </summary>
    public string min_val { get; set; } = "00";
    /// <summary>
    /// 默认不存在
    /// </summary>
    public bool min_bool { get; set; } = false;

    public string def_addr_l { get; set; }
    public string def_addr_h { get; set; }
    /// <summary>
    /// 默认值
    /// </summary>
    public string def_val { get; set; } = "00";
    /// <summary>
    /// 默认不存在
    /// </summary>
    public bool def_bool { get; set; }

    public string cur_addr_l { get; set; }
    public string cur_addr_h { get; set; }
    /// <summary>
    /// 当前值
    /// </summary>
    public string cur_val { get; set; }
    /// <summary>
    /// 默认不存在
    /// </summary>
    public bool cur_bool { get; set; }
}

public class PuctModels
{
    public string addL { get; set; }
    public string valL { get; set; }

    public string addH { get; set; }

    public string valH { get; set; }

    public string Note { get; set; }


}

public class UserParametersUsb
{
    // PID 相关的属性  
    private List<BinBase> pidaddrL;
    public List<BinBase> PidAddrL
    {
        get { return pidaddrL; }
        set { pidaddrL = value; }
    }

    private List<BinBase> pidaddrH;
    public List<BinBase> PidAddrH
    {
        get { return pidaddrH; }
        set { pidaddrH = value; }
    }

    private uint pidNumber;
    public uint PidNumber
    {
        get { return pidNumber; }
        set { pidNumber = value; }
    }

    // VID 相关的属性  
    private List<BinBase> vidaddrL;
    public List<BinBase> VidAddrL
    {
        get { return vidaddrL; }
        set { vidaddrL = value; }
    }

    private List<BinBase> vidaddrH;
    public List<BinBase> VidAddrH
    {
        get { return vidaddrH; }
        set { vidaddrH = value; }
    }

    private uint vidNumber;
    public uint VidNumber
    {
        get { return vidNumber; }
        set { vidNumber = value; }
    }

    // Video 音频相关的属性  
    private int videoMicStartIndex;
    public int VideoMicStartIndex
    {
        get { return videoMicStartIndex; }
        set { videoMicStartIndex = value; }
    }

    private int videoMicEndIndex;
    public int VideoMicEndIndex
    {
        get { return videoMicEndIndex; }
        set { videoMicEndIndex = value; }
    }

    private List<byte> videoMicList;
    public List<byte> VideoMicList
    {
        get { return videoMicList; }
        set { videoMicList = value; }
    }

    private string videoMicName;
    public string VideoMicName
    {
        get { return videoMicName; }
        set { videoMicName = value; }
    }




    // Video 相关的属性  
    private int videoStartIndex;
    public int VideoStartIndex
    {
        get { return videoStartIndex; }
        set { videoStartIndex = value; }
    }

    private int videoEndIndex;
    public int VideoEndIndex
    {
        get { return videoEndIndex; }
        set { videoEndIndex = value; }
    }

    private List<byte> videoList;
    public List<byte> VideoList
    {
        get { return videoList; }
        set { videoList = value; }
    }

    private string videoName;
    public string VideoName
    {
        get { return videoName; }
        set { videoName = value; }
    }

    // Manufacture 相关的属性  
    private int manufactureStartIndex;
    public int ManufactureStartIndex
    {
        get { return manufactureStartIndex; }
        set { manufactureStartIndex = value; }
    }

    private int manufactureEndIndex;
    public int ManufactureEndIndex
    {
        get { return manufactureEndIndex; }
        set { manufactureEndIndex = value; }
    }

    private List<byte> manufactureList;
    public List<byte> ManufactureList
    {
        get { return manufactureList; }
        set { manufactureList = value; }
    }

    private string manufactureName;
    public string ManufactureName
    {
        get { return manufactureName; }
        set { manufactureName = value; }
    }

    // SerialNumber 相关的属性  
    // 注意：这里我修正了字段名中的拼写错误，从seriaNumberName更改为serialNumberName  
    private int serialNumberStartIndex;
    public int SerialNumberStartIndex
    {
        get { return serialNumberStartIndex; }
        set { serialNumberStartIndex = value; }
    }

    private int serialNumberEndIndex;
    public int SerialNumberEndIndex
    {
        get { return serialNumberEndIndex; }
        set { serialNumberEndIndex = value; }
    }

    private List<byte> serialNumberList;
    public List<byte> SerialNumberList
    {
        get { return serialNumberList; }
        set { serialNumberList = value; }
    }

    private string serialNumberName;
    public string SerialNumberName
    {
        get { return serialNumberName; }
        set { serialNumberName = value; }
    }

    // Video CI 和 CP 结果的属性  
    private List<BinBase> videoCIResult;
    public List<BinBase> VideoCIResult
    {
        get { return videoCIResult; }
        set { videoCIResult = value; }
    }

    private List<BinBase> videoCPResult;
    public List<BinBase> VideoCPResult
    {
        get { return videoCPResult; }
        set { videoCPResult = value; }
    }

    //固件版本号
    private List<byte> userVerList;
    public List<byte> UserVerList
    {
        get { return userVerList; }
        set { userVerList = value; }
    }
    /// <summary>
    /// 固件版本号名称
    /// </summary>
    private string userVerName;
    public string UserVerName
    {
        get { return userVerName; }
        set { userVerName = value; }
    }

    
}

/// <summary>
/// Mjpeg 未压缩的帧类型描述符
/// </summary>
public class VideoMjpegFType
{
    /// <summary>
    /// Video Streaming MJPEG Frame Type Descriptor -----bDescriptorSubtype       : 0x07 (MJPEG Frame Type)
    /// </summary>
    private List<BinBase> videoSMjpegFTypeResult;
    public List<BinBase> VideoSMjpegFTypeResult
    {
        get { return videoSMjpegFTypeResult; }
        set { videoSMjpegFTypeResult = value; }
    }
    /// <summary>
    /// bFrameIndex              : 0x01  ///这个是索引符号
    /// </summary>
    public int videoSMjpegFTypeIndex { get; set; }

    /// <summary>
    /// wWidth                   : 0x1F40 (8000)  //宽
    /// </summary>
    public int videoSMjpegFTypeWidth { get; set; }
    /// <summary>
    /// wHeight                  : 0x1770 (6000)   // 高
    /// </summary>
    public int videoSMjpegFTypeHeight { get; set; }

    /// <summary>
    /// 是否被删除
    /// </summary>
    public bool IsDelect { get; set; } = false;

    public string VideoMjpegName { get { return $"{videoSMjpegFTypeWidth}*{videoSMjpegFTypeHeight}"; } }

}
/// <summary>
/// YUV 未压缩的帧类型描述符
/// </summary>
public class VideoYuvFType
{
    /// <summary>
    /// VS Uncompressed Frame Type Descriptor --------bDescriptorSubtype       : 0x05 (Uncompressed Frame Type)    //yuv 尺寸信息
    /// </summary>
    private List<BinBase> videoSYuvFTypeResult;
    public List<BinBase> VideoSYuvFTypeResult
    {
        get { return videoSYuvFTypeResult; }
        set { videoSYuvFTypeResult = value; }
    }

    /// <summary>
    /// bFrameIndex              : 0x01  //索引号
    /// </summary>
    public int videoSYuvFTypeIndex { get; set; }

    /// <summary>
    /// wWidth                   : 0x0900 (2304)  /// 宽
    /// </summary>
    public int videoSYuvFTypeWidth { get; set; }
    /// <summary>
    ///wHeight                  : 0x06C0 (1728)  ///高
    /// </summary>
    public int videoSYuvFTypeHeight { get; set; }
    /// <summary>
    /// 是否被删除
    /// </summary>
    public bool IsDelect { get; set; }

    public string VideoYuvName { get { return $"{videoSYuvFTypeWidth}*{videoSYuvFTypeHeight}"; } }
}


